﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace FRMS.Model
{
    public class Devices
    {
        //public static List<aaaa[]> DQq; 
        public int DevID { get; set; }//keyid
        public string DeviceID { get; set; }
        public string DeviceName { get; set; }
        public string DeviceType { get; set; }
        public string DeviceBuildUnit { get; set; }
        public int BuildID { get; set; }
        public string DeviceElevator { get; set; }
        public string DeviceIP { get; set; }//设备IP
        public string DeviceMask { get; set; }//设备子网掩码
        public string DeviceGateway { get; set; }//设备网关
        public string DeviceDNS { get; set; }//设备DNS
        public string DeviceState { get; set; }//设备状态
        public string DeviceVersion { get; set; }//设备版本
        public string DeviceUpdateTime { get; set; }//状态更新时间
        public string DeviceWorkmode { get; set; }//工作模式
        public string DevicePort { get; set; }//通讯端口
        public string DeviceLoginName { get; set; }//设备登录名称
        public string DeviceLoginPwd { get; set; }//设备登录密码
        public string DeviceDateTime { get; set; }//设备时间   
        public string Floorinfo { get; set; }//楼层
        public string ErrPrompt { get; set; }//错误提示
        public int m_lUserID { get; set; }//设备标识

        //public static string[] TelList;
        //public static string[] DQ { get; set; }
        public void DevicesConnect()
        {
            int m_lUserID;
            //m_bInitSDK = CHCNetSDK.NET_DVR_Init();
            //if (m_bInitSDK == false)
            //{

            //    //return Content("");
            //}
            //else
            //{
            //    CHCNetSDK.NET_DVR_SetLogToFile(3, "C:\\SdkLog\\", true);
            //}
            //登录设备 Login the device
            //string DVRIPAddress = "172.16.1.200";
            //Int16 DVRPortNumber = 8000;
            //string DVRUserName = "admin";
            //string DVRPassword = "admin123456";
            CHCNetSDK.NET_DVR_USER_LOGIN_INFO struLoginInfo = new CHCNetSDK.NET_DVR_USER_LOGIN_INFO();
            CHCNetSDK.NET_DVR_DEVICEINFO_V40 struDeviceInfoV40 = new CHCNetSDK.NET_DVR_DEVICEINFO_V40();
            //int lUserID = -1;

            struLoginInfo.bUseAsynLogin = false;
            //struLoginInfo.cbLoginResult = new CHCNetSDK.LoginResultCallBack(AsynLoginMsgCallback);
            struLoginInfo.byLoginMode = 2;
            struLoginInfo.sUserName = "admin";
            struLoginInfo.sPassword = "admin123456";
            struLoginInfo.sDeviceAddress = "172.16.1.200";//后期用DevicesIP传入值代替
            struLoginInfo.wPort = 8000;
            m_lUserID = CHCNetSDK.NET_DVR_Login_V40(ref struLoginInfo, ref struDeviceInfoV40);
        }
    }
}
